package com.marvels.approve.loan.dao;

import java.util.List;
import java.util.Map;

import com.marvels.approve.loan.dto.LoanForUploadConditionDto;
import com.marvels.approve.loan.dto.McamLoanApplyInfoDTO;
import com.marvels.approve.loan.dto.WaitLendInfoDTO;
import com.marvels.approve.process.dto.DecisionRefusListDTO;
import com.marvels.common.exception.MarvelsBusinessException;

public interface IMcamLoanApplyInfoDao {

	/**新增
	 * @author 何杰
	 * 2018年4月21日
	 * @param loanApplyInfoDTO
	 * @return
	 */
	public int insertByLoanApplyInfo(McamLoanApplyInfoDTO loanApplyInfoDTO);
	/**更新
	 * @param CaseManagerVersionVersion
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public int updateByPrimaryKeySelective(McamLoanApplyInfoDTO loanApplyInfoDTO);
	/**通过主键ID
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public McamLoanApplyInfoDTO selectByPrimaryKey(Long id);
	/**查询多条数据
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<McamLoanApplyInfoDTO> select(McamLoanApplyInfoDTO loanApplyInfoDTO);
	
	/**
	 * 查询记录数
	 * @param loanApplyInfoDTO
	 * @return
	 */
	public Integer selectCount(McamLoanApplyInfoDTO loanApplyInfoDTO);
	
	/**通过loanid查询
	 * @author 何杰
	 * 2018年4月21日
	 * @param loanId
	 * @return
	 */
	public McamLoanApplyInfoDTO selectMcamLoanApplyInfoByLoanId(String loanId);
	
	/**通过身份证查询非本单工单
	 * @param loanApplyInfoDTO
	 * @return
	 */
	public List<McamLoanApplyInfoDTO> selectMcamLoanApplyInfoByCustCardNo(McamLoanApplyInfoDTO loanApplyInfoDTO);
	
	/**通过状态查询，取第一个数据（create_date升序）
	 * @author 何杰
	 * 2018年4月14日
	 * @param status
	 * @return
	 */
	public McamLoanApplyInfoDTO selectFirstStatus(String status); 
	
	
	/**
	 * 查询进件信息(根据放款处理 -放款申请-批量导入  从进件表校验信息的条件dto)
	 * @param loanForUploadConditionDto
	 * @return
	 */
	public McamLoanApplyInfoDTO selectByUploadCondition(LoanForUploadConditionDto loanForUploadConditionDto);
	
	
	/**
	 * 根据loanId进行更新
	 * @param loanApplyInfoDTO
	 * @return
	 */
	public int updateByLoanId(McamLoanApplyInfoDTO mcamLoanApplyInfoDTO);
	
	
	/**
	 * 更新分险参数信息
	 * @param mcamLoanApplyInfoDTO
	 * @return
	 */
	public int updateApplyInfo(McamLoanApplyInfoDTO mcamLoanApplyInfoDTO);
	
	
	/**
	 * 根据产品类别  资金源code查询待放款的进件
	 * @param waitLendInfoDTO
	 * @return
	 */
	public List<String> selectWaitLendInfo(WaitLendInfoDTO infoDTO);
	
	public McamLoanApplyInfoDTO  queryByLoandId(String loanId);
	
	/**
	 * 查询上海资信需要数据
	 * @param loanId
	 * @return
	 */
	public Map<String, Object> selectShzxNeedLoanApplyInfo(McamLoanApplyInfoDTO mcamLoanApplyInfoDTO);
	
	/**
	 * 查询拒绝列表数据
	 * @param decisionRefusListDTO
	 * @return
	 */
	public List<Map<String, Object>> decisionRefusList(DecisionRefusListDTO decisionRefusListDTO);
	
	/**
	 * 通过证件号码查询所有结清的个数
	 * @param identityCardNo
	 * @return
	 */
	public Integer querySettleLoan(String identityCardNo);
}
